package com.gitee.xiao.check;

import org.springframework.context.annotation.Configuration;

/**
 * @author wang xiao
 * date 2024/7/10
 */
@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {

    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        // 注册WebSocket处理器
        registry.addHandler(new FaceDetectionHandler(), "/faceDetection")
                .setAllowedOrigins("*"); // 允许所有域名的跨域请求
    }
}
